package cn.okcmd.log_logback;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.util.ContextInitializer;
import ch.qos.logback.core.joran.spi.JoranException;

/**
 * create by caoqg on 2021/7/15
 * 功能说明:
 */
public class MyLogback {
    public static void main(String[] args) throws JoranException {
        LoggerContext lc = new LoggerContext();
        ContextInitializer ci = new ContextInitializer(lc);
        ci.autoConfig();

        Logger logger = lc.getLogger(MyLogback.class);
        logger.info("hello");
        logger.info("this is {}","other");
        logger.info("this is err",new Throwable("asdfasdf"));
        lc.stop();
    }
}
